import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import externals from "vite-plugin-inject-externals";
import project from "./package.json";

// https://vitejs.dev/config/
export default defineConfig({
  build: {
    lib: {
      entry: `./src/${project.name}.ts`,
      name: project.library,
      formats: ["umd"],
    },
    watch: {},
  },
  plugins: [
    vue(),
    externals({
      modules: [
        {
          name: "x.host",
          global: "x.host",
        },
      ],
    }),
  ],
});
